// 封装函数：获取一个结果：早上|上午|下午|晚上
export const getTime = () => {
    let message = "";
    // 通过内置构造函数Date
    let hours = new Date().getHours();
    message =
        hours <= 6
            ? "凌晨"
            : hours <= 11
                ? "上午"
                : hours <= 13
                    ? "中午"
                    : hours <= 16
                        ? "下午"
                        : hours <= 18
                            ? "傍晚"
                            : "晚上";
    return message;
};